import type { FieldRule } from "@arco-design/web-vue";

export type FormItemProps = {
  field: string;
  label: string;
  tooltip: string;
  showColon: boolean;
  noStyle: boolean;
  disabled: boolean;
  help: string;
  extra: string;
  required: boolean;
  asteriskPosition: string;
  rules: FieldRule<any> | FieldRule<any>[]
  validateStatus: "error" | "success" | "warning" | "validating"
  validateTrigger: "focus" | "input" | "change" | "blur" | ("focus" | "input" | "change" | "blur")[];
  labelColProps: Object;
  wrapperColProps: Object;
  hideLabel: boolean
  hideAsterisk: boolean
  labelColStyle: Object;
  wrapperColStyle: Object;
  rowProps: Object;
  rowClass: (Object | string | [])[];
  contentClass: (Object | string | [])[];
  contentFlex: boolean
  mergeProps: boolean | ((props: Record<string, any>) => Record<string, any>)
  labelColFlex: string | number
  feedback: boolean
  labelComponent: string
  labelAttrs: Object;
}

export type FieldShow = {
  column: boolean
  add: boolean
  edit: boolean
  search: boolean
}

export interface Condition {
  page: number;
  total?: number;
  size: number;
  order: string;
}

export enum ModConditionParamType {
  EQUAL,
  EQUAL_TEXT,
  LIKE_TEXT,
  IN,
  GT,
  LT,
  GTE,
  LTE,
  CONTAIN_KEY,
  ARRAY_EXIST,
  FUNCTION,
  BETWEEN,
  RANGE_BETWEEN,
  NULL_OR_EQUAL,
}

export interface ModConditionParam<T extends BaseData> {
  key: keyof T;
  type: ModConditionParamType;
  value: any;
}

export interface ModCondition<T extends BaseData> extends Condition {
  module: string;
  params: ModConditionParam<T>[];
}

export type ListResult<T> = {
  list: T[];
  count: number;
};

export type HttpResult<T> = {
  msg: string;
  code: number;
  data: T;
  res: boolean;
};

export type ListData<T> = {
  list: T[];
  count: number;
};

export interface BaseData {
  id: number;
  createTime?: number;
  module: string;
}

export interface Mod<T extends BaseData> extends BaseData {
  info: T;
}
export enum PersonType  {
  ADMIN = 1,
  USER = 2
}
export interface Person extends BaseData {
  userName: string;
  password: string;
  roleId: number;
  token: string;
  type:PersonType
}


export interface System extends BaseData{
  name:string
  url:string
  sort:number
}